<template>
	<view class="comments-box">

		<view class="comments-header">
			<view class="comments-header__logo">
				<image :src="comments.wxuser.avatar_text ? comments.wxuser.avatar_text : '/static/user.png'"
					mode="aspectFill"></image>
			</view>
			<view class="comments-header__info">
				<view class="title">{{comments.wxuser.nickname}}</view>
				<view>{{comments.createtime | formatTime}}</view>

				<view class="comments-content">
					<view>{{comments.content}}</view>
				</view>
			</view>
		</view>



	</view>
</template>

<script>
	import {
		parseTime
	} from '@/utils/index.js'
	export default {
		props: {
			comments: {
				type: Object,
				default () {
					return {}
				}
			}
		},
		data() {
			return {

			};
		},
		filters: {
			formatTime(time) {
				return parseTime(time)
			}
		}
	}
</script>

<style lang="scss">
	.comments-box {
		margin: 15px 0;
		overflow: hidden;

		.comments-header {
			display: flex;

			.comments-header__logo {
				flex-shrink: 0;
				width: 30px;
				height: 30px;
				border-radius: 5px;
				overflow: hidden;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.comments-header__info {
				// display: flex;
				// flex-direction: column;
				margin-left: 15px;
				font-size: 12px;
				color: #999;
				line-height: 1;

				.title {
					margin-bottom: 10px;
					font-size: 14px;
					color: #333;

					.replay-text {
						margin: 0 10px;
						font-weight: bold;
						color: #000;
					}
				}

				.comments-content {
					margin-top: 10px;
					font-size: 14px;
					color: #000;
					width: 100%;
					overflow: hidden;
					white-space: normal;
					word-break: break-all;
					word-warp: break-word;
					line-height: 18px;

				}
			}
		}


	}
</style>
